// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.web.forward;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Forward
 * @author Andrei Senchuk
 */
public class Forward implements RequestForwarder {
    private String path;

    public Forward(String path) {
        this.path = path;
    }

    public String getPath() {
        return path;
    }

    public void forward(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
        request.getRequestDispatcher(path).forward(request, response);
    }
}
